/* Stuffer File System header file */

#ifndef _STUFFER_H
#define _STUFFER_H

#define STUFFER_MAGIC       0x5700FFEA
#define STUFFER_VERSION     1

#define FILE_NAME_SIZE      16
#define BLOCK_SIZE          512

// Flags to be used in the "flags" field
#define SFS_FLAG_NOTHING    0
#define SFS_FLAG_EXECUTE    1
#define SFS_FLAG_WRITE      2
#define SFS_FLAG_READ       4
#define SFS_FLAG_MAIN       8

struct stuffer_header_t {
  int magic;
  int version;
  int num_files;
  int total_size;  
};

struct stuffer_entry_t {
  int index;  
  int offset;
  int size;
  int flags;
  char name[FILE_NAME_SIZE];
};

enum stuffer_errors_t {
  SE_OK = 0,       /* Archive has been loaded correctly */
  SE_TOOBIG,       /* Archive is too big for buffer */
  SE_INVALID,      /* Archive is not a valid STUFFER file */
  SE_NOARCHIVE,    /* No archive has been specified in GRUB file */
  SE_TOOMANY       /* Too many modules declared in GRUB file */
};


/* Public functions */
extern void stuffer_initialize(void);
extern int stuffer_get_status(void);
extern void stuffer_show_information(void);
extern void stuffer_make_process_list(void);

#endif /* _STUFFER_H */
